<template>
<div  class="content content_samll">
    <div  class="mews_wrapper">
        <news_template_side :menus="menus"></news_template_side>
        <div class="news_content">
            <detail_service></detail_service>
        </div>
    </div>
</div>
</template> 
<script>
    export default {
        components: {
            news_template_side: () => import("./template_side.vue"),
            detail_service: () => import("./detail_service.vue"),
        },
        data() {
            return {
                menus:[
                    {
                        title:'影像变化图斑',
                        type:0,
                        route:'wfs',
                        fullroute:"/services/ai",
                        childs:[
                            {
                                title:'添加AI变化图斑任务',
                                fullroute:"/services/ai/add_ai_task",
                                props:{
                                    descriptions:[
                                        '变化图斑自动获取服务是基于人工智能核心技术的智能AI学习算法系统，主要实现同一分辨率(相近)的两期不同时相的正射光学影像的变化检测，分辨率支持0.3米-2.0米，本接口实现自动自动化检测并形成geojson格式返回请求者。'
                                    ],
                                    url:'http://talatan.com:29111/static/change/add_ai_task?',
                                    method:'GET',
                                    session:'公开或Authorization授权(Header中的Authorization)',
                                    cors:'跨域可用',
                                    canuse:"不可用",
                                    request:{
                                        parmars:[
                                            {
                                                name:'name',
                                                default:'',
                                                description:'非必须项，AI任务的名称'
                                            },
                                            {
                                                name:'mergeid',
                                                default:'',
                                                description:'非必须项，如果需要该AI任务与其他任务合并时填写',
                                                tooltip:"查看AI任务guid接口",
                                            },
                                            {
                                                name:'taskid',
                                                default:'',
                                                description:'非必须项，AI任务的uuid,服务器自动提供',
                                                tooltip:"查看AI任务guid接口",
                                            },
                                            {
                                                name:'work',
                                                default:'false',
                                                description:'非必须项，计算结果如果需要裁切形成小影像时填写true'
                                            },
                                            {
                                                name:'totask',
                                                default:'false',
                                                description:'非必须项，裁切形成小影像需要人工内业判译是填写true'
                                            },
                                            {
                                                name:'action',
                                                default:'null',
                                                description:'非必须项，任务完成后向调用者回调结果,由使用者自定义的GET接口',
                                                tooltip:"查看变化图斑回调接口",
                                            },
                                            {
                                                name:'pre',
                                                default:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
                                                description:'必须项，前期影像的名称(不带.tif后缀),支持上传本地影像',
                                                tooltip:"查看上传本地影像接口",
                                            },
                                            {
                                                name:'lst',
                                                default:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
                                                description:'必须项，后期影像的名称(不带.tif后缀),支持上传本地影像'
                                            },
                                            {
                                                name:'geom',
                                                default:'',
                                                description:`非必须项，两期影像的重叠范围(用于计算局部),json字符串格式。`,
                                            },
                                            {
                                                name:'soft',
                                                default:'alibaba',
                                                description:`非必须项，AI计算的软件类型,可选择alibaba、baidu，如果同时使用则使用,分割。`,
                                            },
                                            {
                                                name:'area',
                                                default:'50',
                                                description:'非必须项，AI任务按照像素面积过滤的阈值(0~255)'
                                            },
                                            {
                                                name:'threshold',
                                                default:'127',
                                                description:'非必须项，AI任务的名称置信度范围(0~255)'
                                            },
                                        ],
                                        children:[
                                            {
                                                name:'geom',
                                                parmars:[
                                                    {
                                                        name:'type',
                                                        default:'',
                                                        description:'必须项，支持shp-buffer、wkt和geojson。'
                                                    },
                                                    {
                                                        name:'data',
                                                        default:'',
                                                        description:'必须项，只支持标准的MultiPolygon和Polygon,并且只使用用第一个要素。'
                                                    },
                                                ],

                                            },

                                        ]
                                    },
                                    requestcodes:[
                                  `
常规方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为shp-buffer方式：
//获取.shp文件的buffer
let reader = new FileReader();
reader.onload = (ev)=> {
    if(ev.target.result) {
        let _buffer =JSON.stringify(Array.prototype.slice.call(new Int8Array(ev.target.result)))
    }
};
reader['readAsArrayBuffer'](file); 
//发送请求
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'shp-buffer',
            //arcgis shape格式中的shape文件的二进制数据
            data:_buffer // 例如：'[2,1,4,6,87,8,0,1,2,3]'

        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为wkt方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'wkt',
            //不限定英文大小写
            //标准POLYGON
            data:'POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10))'
            //标准POLYGON （有洞）
            //POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30)) //标准POLYGON （有洞）
            //标准MULTIPOLYGON
            //MULTIPOLYGON (((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)))
        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为geojson方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'geojson',
            data:'{ "type": "Polygon", "coordinates": [ [[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]] ] }'
            //标准MULTIPOLYGON
            //{ "type": "MultiPolygon", "coordinates": [ [[[109.2041015625,30.088107753367257],[115.02685546875,30.088107753367257],[115.02685546875,32.7872745269555],[109.2041015625,32.7872745269555],[109.2041015625,30.088107753367257]]],[[[112.9833984375,26.82407078047018],[116.69677734375,26.82407078047018],[116.69677734375,29.036960648558267],[112.9833984375,29.036960648558267],[112.9833984375,26.82407078047018]]]] } 
        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                        
                                    ],
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'session_id',
                                            default:'',
                                            description:'必有项，AI任务的taskid'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的结果信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": {},
  "session_id":'',
  "message": ""
}`,
                                }
                                
                            },
                            {
                                title:'变化图斑回调',
                                props:{
                                    descriptions:[
                                        '变化图斑回调是由使用者自行开发的后台回调路径,并在add_ai_task接口中的action参数中设置,由卫星应用技术中心向使用者发送。',
                                        '本接口只返回一次，请确保接口保持畅通。'
                                    ],
                                    url:'用户自定义',
                                    method:'GET',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    canuse:"不可用",
                                    
                                    request:{
                                        parmars:[
                                            {
                                                name:'session_id',
                                                default:'',
                                                description:'必有项，变化图斑AI任务的任务session_id'
                                            },
                                            {
                                                name:'status',
                                                default:'',
                                                description:'必有项，变化图斑检测任务是否成功'
                                            },
                                            {
                                                name:'result',
                                                default:'',
                                                description:'非必有项，变化图斑检测任务成功时发送的数组字符串结果，数组中每个结果为一个对象'
                                            },
                                            {
                                                name:'message',
                                                default:'',
                                                description:'非必有项，变化图斑检测任务失败时返回错误信息'
                                            },
                                        ],
                                        
                                    }
                                    
                                }
                            },
                            {
                                title:'AI任务guid',
                                props:{
                                    descriptions:[
                                        '一般由服务器返回指定格式的guid，格式为53fc156d_8011_455c_9c9a_627068f4。',
                                    ],
                                    url:'https://nmgwxyy.cn/alatan/static/change/guid?',
                                    method:'GET',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    canuse:"可用",
                                    requestcodes:`
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'https://nmgwxyy.cn/alatan/static/change/guid?', 
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的guid'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": "651e2420_4c45_446a_b12a_15f99a7e",
  "message": ""
}`,

                                },
                                
                            },
                            {
                                title:'上传本地影像接口',
                                props:{
                                    descriptions:[
                                        '用于上传本地自定义的影像数据到服务器,影像数据为tif格式、经纬度坐标系、3波段，参数类型为FormData。',
                                        '普通用户可以使用上传界面(http://talatan.com:29111/task/uploads?)。'
                                    ],
                                    url:'https://nmgwxyy.cn/alatan/static/change/uploads?',
                                    method:'POST',
                                    session:'Authorization授权(Header中的Authorization)',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'split',
                                                default:'',
                                                description:'必须项，上传时的参数'
                                            },
                                            {
                                                name:'file',
                                                default:'',
                                                description:'必须项，文件切块二进制'
                                            },
                                        ],
                                        children:[
                                            {
                                                name:'split',
                                                parmars:[
                                                    {
                                                        name:'chunk',
                                                        default:'',
                                                        description:'必须项，分块上传时的文件序号，从1开始。'
                                                    },
                                                    {
                                                        name:'chunks',
                                                        default:'',
                                                        description:'必须项，分块上传时的分块数量。'
                                                    },
                                                    {
                                                        name:'length',
                                                        default:'',
                                                        description:'必须项，分块上传时的分块字节长度'
                                                    },
                                                    {
                                                        name:'eachSize',
                                                        default:'',
                                                        description:'必须项，分块上传时的分块大小'
                                                    },
                                                    {
                                                        name:'fileName',
                                                        default:'',
                                                        description:'必须项，文件名'
                                                    },
                                                    {
                                                        name:'fullSize',
                                                        default:'',
                                                        description:'必须项，文件的字节总长度'
                                                    }
                                                ],

                                            }

                                        ]
                                    },
                                    requestcodes:`
let formData = new FormData()
let split={
    chunk:'',
    chunks:'',
    length:'',
    eachSize:'',
    fileName:'',
    fullSize:'',
}
formData.append("split", JSON.stringify(split))
formData.append("file", fileChunk)//fileChunk为分块字节数据
$.ajax({
    type:"post",
    async:true,
    url:'https://nmgwxyy.cn/alatan/static/change/uploads?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    contentType: false, 
    processData: false,
    data:formData
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": {
      filename:''
      end:true;//文件是否已经完整上传
  },
  "message": ""
}`,

                                },
                                
                            },
                            {
                                title:'AI变化图斑状态获取',
                                props:{
                                    descriptions:[
                                        '获取AI软件的变化图斑的运行状态。',
                                    ],
                                    url:'http://talatan.com:29111/static/change/search_ai_task_status?',
                                    method:'GET',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'session',
                                                default:'',
                                                description:'必须项，AI任务的taskid'
                                            },
                                        ],
                                    },
                                    requestcodes:`
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/search_ai_task_status?', 
    data:{
        session:'your taskid'
    }
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": {},
  "message": ""
}`,

                                },
                                
                            },
                             {
                                title:'变化图斑任务获取',
                                props:{
                                    descriptions:[
                                        '获取变化图斑任务列表',
                                    ],
                                    url:'http://talatan.com:29111/static/change/search_task?',
                                    method:'GET',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                             {
                                                name:'name',
                                                default:'',
                                                description:'非必须项，变化图斑任务的名称'
                                            },
                                            {
                                                name:'taskid',
                                                default:'',
                                                description:'非必须项，变化图斑任务的taskid(对应其他接口的mergeid)'
                                            },
                                            {
                                                name:'status',
                                                default:'',
                                                description:'非必须项，变化图斑任务状态:-2(未分配)、-1(未开始)、0(判译中)、1(判译结束)、5(已完成)。多选时以,分割，如:-2,-1,0',

                                            },
                                            {
                                                name:'pagesize',
                                                default:'10',
                                                description:'非必须项，分页查询时的单页记录数'
                                            },
                                            {
                                                name:'pagenum',
                                                default:'1',
                                                description:'非必须项，分页查询时的页码数'
                                            },
                                            {
                                                name:'skip',
                                                default:'0',
                                                description:'非必须项，跳过记录数'
                                            },
                                        ],
                                    },
                                    requestcodes:`
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/search_task?', 
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result":
    {
        //查询的数据
        data: [
            {}
        ],
        page: {
            //查询筛选数量
            count: 1000, 
            //全部记录
            countAll: 1000, 
            //分页页码
            pagenum: 1, 
            //分页数量
            pagesize: 10,
            //跳过数量
            skip: 0
        }
  },
  "message": ""
}`,

                                },
                                
                            },
                            {
                                title:'变化图斑详情查询',
                                props:{
                                    descriptions:[
                                        '获取变化图斑的空间信息、属性信息以及变化状态等。',
                                    ],
                                    url:'http://talatan.com:29111/static/change/search?',
                                    method:'GET',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'mergeid',
                                                default:'',
                                                description:'必须项，对应图斑判译任务的taskid'
                                            },
                                            {
                                                name:'taskid',
                                                default:'',
                                                description:'非必须项，AI任务的taskid'
                                            },
                                            {
                                                name:'name',
                                                default:'',
                                                description:'非必须项，图斑判译任务的名称'
                                            },
                                            {
                                                name:'code',
                                                default:'',
                                                description:'非必须项，对应的图斑编号(可能并不唯一),配合AI任务的taskid保证唯一'
                                            },
                                            {
                                                name:'xzqh',
                                                default:'',
                                                description:'非必须项，对应的图斑所在的旗县编码(6位编码如15023)'
                                            },
                                            {
                                                name:'status',
                                                default:'',
                                                description:'非必须项，图斑状态:-2(未分配)、-1(未人工判译)、1(人工判译未变化)、2(人工判译变化)、3(专题合法变化图斑)、4(自查未变化图斑)、5(疑似违法图斑)。多选时以,分割，如:1,2,3',

                                            },
                                            {
                                                name:'pagesize',
                                                default:'10',
                                                description:'非必须项，分页查询时的单页记录数'
                                            },
                                            {
                                                name:'pagenum',
                                                default:'1',
                                                description:'非必须项，分页查询时的页码数'
                                            },
                                            {
                                                name:'skip',
                                                default:'0',
                                                description:'非必须项，跳过记录数'
                                            },
                                            {
                                                name:'onlyid',
                                                default:'',
                                                description:'非必须项，只返回数据库记录ID号时设定true，优先级比nogeom高'
                                            },
                                            {
                                                name:'nogeom',
                                                default:'',
                                                description:'非必须项，不需要空间坐标时设定true'
                                            }
                                        ],
                                    },
                                    requestcodes:`
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/search?', 
    data:{
        mergeid:'a070871a_75a9_4974_8374_11e0e75b'
    }
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result":
    {
        //查询的数据
        data: [
            {}
        ],
        page: {
            //查询筛选数量
            count: 1000, 
            //全部记录
            countAll: 1000, 
            //分页页码
            pagenum: 1, 
            //分页数量
            pagesize: 10,
            //跳过数量
            skip: 0
        }
  },
  "message": ""
}`,

                                },
                                
                            },
                            {
                                title:'单个变化图斑状态更新',
                                props:{
                                    descriptions:[
                                        '更新单个变化图斑的状态信息status。',
                                    ],
                                    url:'http://talatan.com:29111/static/change/update_task_detail?',
                                    method:'POST',
                                    session:'Authorization授权(Header中的Authorization)',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'mergeid',
                                                default:'',
                                                description:'必须项，对应图斑判译任务的taskid'
                                            },
                                            {
                                                name:'taskid',
                                                default:'',
                                                description:'必须项，AI任务的taskid'
                                            },
                                            {
                                                name:'code',
                                                default:'',
                                                description:'必须项，对应的图斑编号(可能并不唯一),配合AI任务的taskid保证唯一'
                                            },
                                            {
                                                name:'status',
                                                default:'',
                                                description:'必须项，该接口图斑状态只能是：专题合法变化图斑(代号3)、自查未变化图斑(代号4)、疑似违法图斑(代号5)',

                                            },
                                            {
                                                name:'message',
                                                default:'',
                                                description:'必须项，图斑简要描述信息(为什么违法、为什么没有违法)'
                                            },
                                        ],
                                    },
                                    requestcodes:`
$.ajax({
    type:"post",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/update_task_detail?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        mergeid:'a070871a_75a9_4974_8374_11e0e75b',
        taskid:'553250a4_df68_4c6b_854b_2f5ea4f8',
        code:'ZT150623202103020001',
        status:4,
        message:'实地为农作物堆叠',
    }
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result":{},
  "message": ""
}`,

                                },
                                
                            },
                            
                        ]
                    },
                    {
                        title:'用户登录',
                         childs:[
                            {
                                title:'登录获取token',
                                fullroute:"/services/ai/add_ai_task",
                                props:{
                                    descriptions:[
                                        '登录获取token,有效时间24小时.更多功能可以使用统一用户认证管理系统的API接口(https://onemap.img.net/uums_docs/#/UserRestService-login)，对应地址为http://talatan.com:29111/image/UUMS/rest/user/getToken?'
                                    ],
                                    url:'http://talatan.com:29111/static/change/login_user?',
                                    method:'POST',
                                    session:'公开访问',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'username',
                                                default:'',
                                                description:'必须项，username'
                                            },
                                            {
                                                name:'password',
                                                default:'',
                                                description:'非必须项，password'
                                            },
                                            
                                        ]
                                    },
                                    requestcodes:[
                                  `
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/login_user?',
    data:{
        username:'your username',
        password:'your password',
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,

                                        
                                    ],
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的token'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": 'the token',
  "message": ""
}`,
                                }
                                
                            },
                            {
                                title:'获取个人信息',
                                fullroute:"/services/ai/add_ai_task",
                                props:{
                                    descriptions:[
                                        '变化图斑自动获取服务是基于人工智能核心技术的智能AI学习算法系统，主要实现同一分辨率(相近)的两期不同时相的正射光学影像的变化检测，分辨率支持0.3米-2.0米，本接口实现自动自动化检测并形成geojson格式返回请求者。'
                                    ],
                                    url:'http://talatan.com:29111/static/change/add_ai_task?',
                                    method:'GET',
                                    session:'公开或Authorization授权(Header中的Authorization)',
                                    cors:'跨域可用',
                                    request:{
                                        parmars:[
                                            {
                                                name:'name',
                                                default:'',
                                                description:'非必须项，AI任务的名称'
                                            },
                                            {
                                                name:'mergeid',
                                                default:'',
                                                description:'非必须项，如果需要该AI任务与其他任务合并时填写',
                                                tooltip:"查看AI任务guid接口",
                                            },
                                            {
                                                name:'taskid',
                                                default:'',
                                                description:'非必须项，AI任务的uuid,服务器自动提供',
                                                tooltip:"查看AI任务guid接口",
                                            },
                                            {
                                                name:'work',
                                                default:'false',
                                                description:'非必须项，计算结果如果需要裁切形成小影像时填写true'
                                            },
                                            {
                                                name:'totask',
                                                default:'false',
                                                description:'非必须项，裁切形成小影像需要人工内业判译是填写true'
                                            },
                                            {
                                                name:'action',
                                                default:'null',
                                                description:'非必须项，任务完成后向调用者回调结果,由使用者自定义的GET接口',
                                                tooltip:"查看变化图斑回调接口",
                                            },
                                            {
                                                name:'pre',
                                                default:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
                                                description:'必须项，前期影像的名称(不带.tif后缀),支持上传本地影像',
                                                tooltip:"查看上传本地影像接口",
                                            },
                                            {
                                                name:'lst',
                                                default:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
                                                description:'必须项，后期影像的名称(不带.tif后缀),支持上传本地影像'
                                            },
                                            {
                                                name:'geom',
                                                default:'',
                                                description:`非必须项，两期影像的重叠范围(用于计算局部),json字符串格式。`,
                                            },
                                            {
                                                name:'soft',
                                                default:'alibaba',
                                                description:`非必须项，AI计算的软件类型,可选择alibaba、baidu，如果同时使用则使用,分割。`,
                                            },
                                            {
                                                name:'area',
                                                default:'50',
                                                description:'非必须项，AI任务按照像素面积过滤的阈值(0~255)'
                                            },
                                            {
                                                name:'threshold',
                                                default:'127',
                                                description:'非必须项，AI任务的名称置信度范围(0~255)'
                                            },
                                        ],
                                        children:[
                                            {
                                                name:'geom',
                                                parmars:[
                                                    {
                                                        name:'type',
                                                        default:'',
                                                        description:'必须项，支持shp-buffer、wkt和geojson。'
                                                    },
                                                    {
                                                        name:'data',
                                                        default:'',
                                                        description:'必须项，只支持标准的MultiPolygon和Polygon,并且只使用用第一个要素。'
                                                    },
                                                ],

                                            },

                                        ]
                                    },
                                    requestcodes:[
                                  `
常规方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为shp-buffer方式：
//获取.shp文件的buffer
let reader = new FileReader();
reader.onload = (ev)=> {
    if(ev.target.result) {
        let _buffer =JSON.stringify(Array.prototype.slice.call(new Int8Array(ev.target.result)))
    }
};
reader['readAsArrayBuffer'](file); 
//发送请求
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'shp-buffer',
            //arcgis shape格式中的shape文件的二进制数据
            data:_buffer // 例如：'[2,1,4,6,87,8,0,1,2,3]'

        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为wkt方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'wkt',
            //不限定英文大小写
            //标准POLYGON
            data:'POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10))'
            //标准POLYGON （有洞）
            //POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30)) //标准POLYGON （有洞）
            //标准MULTIPOLYGON
            //MULTIPOLYGON (((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)),((6 3,9 2,9 4,6 3)))
        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
`
geom type为geojson方式：
$.ajax({
    type:"get",
    async:true,
    dataType:"json",
    url:'http://talatan.com:29111/static/change/add_ai_task?',
    beforeSend: (xhr)=> {
        xhr.setRequestHeader("Authorization", "your token");
    },
    data:{
        pre:'JKF01_0075_00038570_20210125111233_0PMS05_003_F',
        lst:'JKF01_0075_00043768_20210311111107_0PMS06_003_F',
        geom:JSON.stringify({
            type:'geojson',
            data:'{ "type": "Polygon", "coordinates": [ [[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]] ] }'
            //标准MULTIPOLYGON
            //{ "type": "MultiPolygon", "coordinates": [ [[[109.2041015625,30.088107753367257],[115.02685546875,30.088107753367257],[115.02685546875,32.7872745269555],[109.2041015625,32.7872745269555],[109.2041015625,30.088107753367257]]],[[[112.9833984375,26.82407078047018],[116.69677734375,26.82407078047018],[116.69677734375,29.036960648558267],[112.9833984375,29.036960648558267],[112.9833984375,26.82407078047018]]]] } 
        })
    }  
})
.then(result=>{
    console.log(result)
})
.catch(error =>{
    console.log("error", error)
})`,
                                        
                                    ],
                                    back:[
                                        {
                                            name:'status',
                                            default:'',
                                            description:'必有项，任务成功返回true,错误返回false'
                                        },
                                        {
                                            name:'session_id',
                                            default:'',
                                            description:'必有项，AI任务的taskid'
                                        },
                                        {
                                            name:'result',
                                            default:'',
                                            description:'任务成功返回的结果信息'
                                        },
                                        {
                                            name:'message',
                                            default:'',
                                            description:'任务成功错误时返回的错误信息'
                                        },
                                    ],
                                    backcodes:`
{
  "status": true,
  "result": {},
  "session_id":'',
  "message": ""
}`,
                                }
                            },
                            
                        ]
                    },
                ]
            }
        },
    }
</script>
<style>
.codes [class^="code"]{
    color: white;
}
.content.content_samll {
    padding-top: 30px;
    width: 1300px;
    margin: 0 auto;
}
.mews_wrapper {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    background-color: #fff;
}
.mews_wrapper .news-template-side {
    width: 240px;
    height: inherit;
    padding-bottom: 40px;
    border-right: 1px solid #dddfe4;
}
.mews_wrapper .news_content {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 20px 20px 40px;
    overflow: hidden;
}
.news-template-side-title {
    height: 68px;
    margin: 0;
    text-align: center;
    font-size: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: left;
    -ms-flex-pack: left;
    justify-content: left;
    padding-left: 20px;
    color: #fff;
    background: url() no-repeat 0 0;
    background-size: 100%;
    font-weight: 500;
}
.side-nav, .dropdown-menu, .filter-dropdown-list {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid #efefef;
    border-top: none;
    font-weight: 400;
    font-style: normal;
    background-color: #ffffff;
}
</style>